import*as e from"../../core/common/common.js";import*as t from"../../ui/legacy/legacy.js";import*as o from"../../core/i18n/i18n.js";const s={console:"Console",showConsole:"Show Console",clearConsole:"Clear console",clearConsoleHistory:"Clear console history",createLiveExpression:"Create live expression",hideNetworkMessages:"Hide network messages",showNetworkMessages:"Show network messages",selectedContextOnly:"Selected context only",onlyShowMessagesFromTheCurrent:"Only show messages from the current context (`top`, `iframe`, `worker`, extension)",showMessagesFromAllContexts:"Show messages from all contexts",logXmlhttprequests:"Log XMLHttpRequests",showTimestamps:"Show timestamps",hideTimestamps:"Hide timestamps",autocompleteFromHistory:"Autocomplete from history",doNotAutocompleteFromHistory:"Do not autocomplete from history",autocompleteOnEnter:"Accept autocomplete suggestion on Enter",doNotAutocompleteOnEnter:"Do not accept autocomplete suggestion on Enter",groupSimilarMessagesInConsole:"Group similar messages in console",doNotGroupSimilarMessagesIn:"Do not group similar messages in console",showCorsErrorsInConsole:"Show `CORS` errors in console",doNotShowCorsErrorsIn:"Do not show `CORS` errors in console",eagerEvaluation:"Eager evaluation",eagerlyEvaluateConsolePromptText:"Eagerly evaluate console prompt text",doNotEagerlyEvaluateConsole:"Do not eagerly evaluate console prompt text",evaluateTriggersUserActivation:"Treat code evaluation as user action",treatEvaluationAsUserActivation:"Treat evaluation as user activation",doNotTreatEvaluationAsUser:"Do not treat evaluation as user activation",expandConsoleTraceMessagesByDefault:"Automatically expand `console.trace()` messages",collapseConsoleTraceMessagesByDefault:"Do not automatically expand `console.trace()` messages"},n=o.i18n.registerUIStrings("panels/console/console-meta.ts",s),i=o.i18n.getLazilyComputedLocalizedString.bind(void 0,n);let a;async function r(){return a||(a=await import("./console.js")),a}t.ViewManager.registerViewExtension({location:"panel",id:"console",title:i(s.console),commandPrompt:i(s.showConsole),order:20,loadView:async()=>(await r()).ConsolePanel.ConsolePanel.instance()}),t.ViewManager.registerViewExtension({location:"drawer-view",id:"console-view",title:i(s.console),commandPrompt:i(s.showConsole),persistence:"permanent",order:0,loadView:async()=>(await r()).ConsolePanel.WrapperView.instance()}),t.ActionRegistration.registerActionExtension({actionId:"console.show",category:t.ActionRegistration.ActionCategory.CONSOLE,title:i(s.showConsole),loadActionDelegate:async()=>(await r()).ConsoleView.ActionDelegate.instance(),bindings:[{shortcut:"Ctrl+`",keybindSets:["devToolsDefault","vsCode"]}]}),t.ActionRegistration.registerActionExtension({actionId:"console.clear",category:t.ActionRegistration.ActionCategory.CONSOLE,title:i(s.clearConsole),iconClass:"clear",loadActionDelegate:async()=>(await r()).ConsoleView.ActionDelegate.instance(),contextTypes(){return e=e=>[e.ConsoleView.ConsoleView],void 0===a?[]:e(a);var e},bindings:[{shortcut:"Ctrl+L"},{shortcut:"Meta+K",platform:"mac"}]}),t.ActionRegistration.registerActionExtension({actionId:"console.clear.history",category:t.ActionRegistration.ActionCategory.CONSOLE,title:i(s.clearConsoleHistory),loadActionDelegate:async()=>(await r()).ConsoleView.ActionDelegate.instance()}),t.ActionRegistration.registerActionExtension({actionId:"console.create-pin",category:t.ActionRegistration.ActionCategory.CONSOLE,title:i(s.createLiveExpression),iconClass:"eye",loadActionDelegate:async()=>(await r()).ConsoleView.ActionDelegate.instance()}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.hideNetworkMessages),settingName:"hideNetworkMessages",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:i(s.hideNetworkMessages)},{value:!1,title:i(s.showNetworkMessages)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.selectedContextOnly),settingName:"selectedContextFilterEnabled",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:i(s.onlyShowMessagesFromTheCurrent)},{value:!1,title:i(s.showMessagesFromAllContexts)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.logXmlhttprequests),settingName:"monitoringXHREnabled",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.showTimestamps),settingName:"consoleTimestampsEnabled",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:i(s.showTimestamps)},{value:!1,title:i(s.hideTimestamps)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,title:i(s.autocompleteFromHistory),settingName:"consoleHistoryAutocomplete",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.autocompleteFromHistory)},{value:!1,title:i(s.doNotAutocompleteFromHistory)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.autocompleteOnEnter),settingName:"consoleAutocompleteOnEnter",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!1,options:[{value:!0,title:i(s.autocompleteOnEnter)},{value:!1,title:i(s.doNotAutocompleteOnEnter)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.groupSimilarMessagesInConsole),settingName:"consoleGroupSimilar",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.groupSimilarMessagesInConsole)},{value:!1,title:i(s.doNotGroupSimilarMessagesIn)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,title:i(s.showCorsErrorsInConsole),settingName:"consoleShowsCorsErrors",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.showCorsErrorsInConsole)},{value:!1,title:i(s.doNotShowCorsErrorsIn)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.eagerEvaluation),settingName:"consoleEagerEval",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.eagerlyEvaluateConsolePromptText)},{value:!1,title:i(s.doNotEagerlyEvaluateConsole)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.evaluateTriggersUserActivation),settingName:"consoleUserActivationEval",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.treatEvaluationAsUserActivation)},{value:!1,title:i(s.doNotTreatEvaluationAsUser)}]}),e.Settings.registerSettingExtension({category:e.Settings.SettingCategory.CONSOLE,storageType:e.Settings.SettingStorageType.Synced,title:i(s.expandConsoleTraceMessagesByDefault),settingName:"consoleTraceExpand",settingType:e.Settings.SettingType.BOOLEAN,defaultValue:!0,options:[{value:!0,title:i(s.expandConsoleTraceMessagesByDefault)},{value:!1,title:i(s.collapseConsoleTraceMessagesByDefault)}]}),e.Revealer.registerRevealer({contextTypes:()=>[e.Console.Console],loadRevealer:async()=>(await r()).ConsolePanel.ConsoleRevealer.instance(),destination:void 0});
